Ext.define('App.view.home.Carousel', {
    extend: 'Ext.Carousel',
    id: 'homeCarousel',
    xtype: 'homeCarousel',
    
    
    config: {
		tpl: '<img src="http://localhost:9080/{image}" height="200px" width="100%">'
    },
    
    
    initialize: function(){
        Ext.data.JsonP.request({
            url: 'http://localhost:9080/inewsServer/findHomeImage.action',
            callbackKey: 'callback',
            params: {
                mainType: '92'
            },
            success: function(result){
                var roots = result.root;
                Ext.Array.each(roots, function(root){
                    var image = root.image;
                    if (!Ext.isEmpty(image)) {
						var news = Ext.create('App.model.News', {
    						image: image
						});
						Ext.getCmp("homeCarousel").setRecord(news);
                    }
                });
            }
        });
    }
    
    
    
    
});
